

package com.friendfeed.api;

public class File  implements java.io.Serializable {
    private String url;
    private String type; // MIME type
    private String name;
    private String icon; // URL to icon
    private Long size; // size in bytes

    public File() {
    		super();
    }

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getUrl()
	{
		return url;
	}

	public void setUrl(String url)
	{
		this.url = url;
	}

	public String getIcon()
	{
		return icon;
	}

	public void setIcon(String icon)
	{
		this.icon = icon;
	}

	public Long getSize()
	{
		return size;
	}

	public void setSize(Long sz)
	{
		this.size = sz;
	}

	
	public String getType()
	{
		return type;
	}

	public boolean isPdf()
	{
		return "application/pdf".equals(getType());
	}
	
	public boolean isJpeg()
	{
		return "image/jpeg".equals(getType());
	}

	public boolean isGif()
	{
		return "image/gif".equals(getType());
	}

	public boolean isPng()
	{
		return "image/png".equals(getType());
	}
	
	public boolean isTiff()
	{
		return "image/tiff".equals(getType());
	}
	
	public boolean isCsv()
	{
		return "text/csv".equals(getType());
	}
	
	public boolean isPlainText()
	{
		return "text/plain".equals(getType());
	}
	
	public boolean isMp3()
	{
		return "audo/mpeg".equals(getType());
	}
	
	public boolean isMp4Video()
	{
		return "video/mp4".equals(getType());
	}
	
	public void setType(String type)
	{
		this.type = type;
	}

	public String toString()
	{
		return getName();
	}
    
}
